package com.dxt.rabbitmq.service.topic;

import com.dxt.rabbitmq.config.TopicModeConfig;
import com.dxt.rabbitmq.vo.TestMessage;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicModeConsumerTwo {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @RabbitListener(queues = TopicModeConfig.QUEUE2)
    public void consume(TestMessage testMessage){
        System.out.println("TopicModeConsumerTwo get message: " + testMessage.toString());
    }
}
